<?php
namespace App\Services\Common;
use Illuminate\Pagination\LengthAwarePaginator;

/**
 * 重写分页参数
 * Class LengthAwarePaginatorService
 * @package App\Services\Common
 */
class LengthAwarePaginatorService extends LengthAwarePaginator
{
    public function toArray()
    {
        return [
            'item_list' => $this->items->toArray(),
            'total' => $this->total(),
            'page' => $this->currentPage(),
            'count' => $this->count(),
            'is_next' => $this->hasMorePages(),
            'last_page' => $this->lastPage(),
        ];
    }
}
